using System.ComponentModel;
using System.Web.UI;
using AjaxControlToolkit;

[assembly: WebResource("jQueryNET.Data.WebServiceDataSource.js", "application/x-javascript", PerformSubstitution = true)]

namespace jQueryNET
{
	[ClientScriptResource("jQueryNET.Data.WebServiceDataSource", "jQueryNET.Data.WebServiceDataSource.js")]
	public class WebServiceSource : DataSourceBase
	{
		#region Public properties

		/// <summary>
		/// 
		/// </summary>
		[Description("Data service url")]
		[Category("Behavior")]
		[ExtenderControlProperty]
		[ClientPropertyName("serviceUrl")]
		public string ServiceUrl
		{
			get { return (string)(ViewState["ServiceUrl"] ?? string.Empty); }
			set { ViewState["ServiceUrl"] = value; }
		}

		/// <summary>
		/// 
		/// </summary>
		[Description("Data service method")]
		[Category("Behavior")]
		[ExtenderControlProperty]
		[ClientPropertyName("serviceMethod")]
		public string ServiceMethod
		{
			get { return (string)(ViewState["ServiceMethod"] ?? string.Empty); }
			set { ViewState["ServiceMethod"] = value; }
		}

		/// <summary>
		/// 
		/// </summary>
		[Description("Web service request timeout")]
		[Category("Behavior")]
		[ExtenderControlProperty]
		[ClientPropertyName("timeout")]
		public int Timeout
		{
			get { return (int)(ViewState["Timeout"] ?? 0); }
			set { ViewState["Timeout"] = value; }
		}

		[Description("Web service parameters")]
		[Category("Behavior")]
		[ExtenderControlProperty(true, true)]
		[ClientPropertyName("parameters")]
		public object Parameters
		{
			get { return ViewState["Parameters"]; }
			set { ViewState["Parameters"] = value; }
		}

		#endregion
	}
}